-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove "is-email" from testing suite #1247
Remove "is-email" from testing suite #1247
Conversation
@@ -34,7 +34,6 @@ | |||
"eslint": "^8.57.0", | |||
"eslint-config-prettier": "^9.1.0", | |||
"eslint-plugin-prettier": "^5.1.3", | |||
"is-email": "^1.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is-email
is a package that validates an email. It requires using a custom type to use, and its only used when testing refiners
. Removing this allows us to remove /@types
.
import { string, refine } from '../../../src' | ||
|
||
export const Struct = refine(string(), 'email', isEmail) | ||
export const Struct = refine(string(), 'email', (value) => value.includes('@')) | ||
|
||
export const data = 'invalid' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, I've simply made the test for a refiner check that there is an @
symbol in the data. Since we weren't testing whether it actually works with emails, this seems simpler and within the scope of this commit.
Removing the All the modules under Using Vitest would also makes it a lot clearer what is actually happening with all those files -- a major plus in my book! |
a6c374e
to
cb3bb0d
Compare
is-email
from testing suite
is-email
from testing suitecb3bb0d
to
8a40893
Compare
Cool! Will keep those then. I've refactored this PR to just contain the changes for |
@yeoffrey FYI: I noticed that the is-email was used in the examples dir, along with some other similar helper packages. I added a small README and a custom package.json to that dir so that we can remove all of these from the root. |
No worries at all. Thanks for doing that! |
Removing
is-email
from the testing suite. Its used as a dev dependency only when testingrefine
, and it creates some complexity because we need to type that function. Not worth it in my opinion!Related: #1244